gsub_file 'Gemfile', 'rubygems', 'ruby.taobao'

gem "bootstrap-sass"
gem "figaro"

gem_group :staging, :production do
   gem 'unicorn'
end

gem_group :development do
  gem 'pry-rails'
  gem 'pry-byebug'

  # capistrano
  gem 'capistrano-rails'
  gem 'capistrano-rvm'
  gem 'capistrano3-unicorn'

  gem 'annotate'
end

run "bundle install"
run "figaro install"

generate :controller, 'welcome', 'index'
route "root 'welcome#index'"

# TODO unicorn app path
file 'config/unicorn.rb', File.read("#{File.dirname(__FILE__)}/unicorn.rb")
file 'config/environments/staging.rb', File.read("config/environments/production.rb")
file 'config/application.yml.example', File.read("config/application.yml")
file 'config/database.yml.example', File.read("config/database.yml")
run "mv README.rdoc README.md"
append_file '.gitignore', '/config/database.yml'
gsub_file 'config/routes.rb', "get 'welcome/index'", ""

# git commit
git :init
git add: "."
git commit: '-m "First commit!"'

